// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueRouter from "vue-router";
import axios from 'axios'
import ElementUI from 'element-ui'
import drag from './utils/el-drag'
import vuedrag from './utils/vue-drag'
import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/reset.css'
import {handleTree} from "@/utils/tool";
import '@/utils/directive'

Vue.use(ElementUI);

Vue.config.productionTip = false
Vue.prototype.axios = axios;
axios.defaults.withCredentials = true;
Vue.prototype.handleTree = handleTree

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

//地图
import vueMap from 'vue-amap'

Vue.use(vueMap)

vueMap.initAMapApiLoader({
  // 高德的key
  key: '7e04772c16c565a3a2f1cfab417cc5e8',
  // 插件集合
  plugin: ['AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','AMap.Ceocoder'],
  v: '2.0',
})



/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
